﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace StaffModule.Models {
    /// <summary>
    /// 缺岗数据模型
    /// </summary>
    [Table("StuffOutWorkModel")]
     public class StuffOutWorkModel : INotifyPropertyChanged {
        //属性变更通知
        public event PropertyChangedEventHandler? PropertyChanged;

        /// <summary>
        /// 员工ID
        /// </summary>
        private int _Id;
        [Key]
        public int Id {
            get { return _Id; }
            set { _Id = value;
                PropertyChanged?.Invoke(this, new PropertyChangedEventArgs("Id"));
            }
        }

        //员工工号
        private string _EmployeeId;

        public string EmployeeId {
            get { return _EmployeeId; }
            set {
                _EmployeeId = value;
                PropertyChanged?.Invoke(this, new PropertyChangedEventArgs("EmployeeId"));
            }
        }


        /// <summary>
        /// 缺岗次数
        /// </summary>
        private int _OutWorkCount;

        public int OutWorkCount {
            get { return _OutWorkCount; }
            set { _OutWorkCount = value;
                PropertyChanged?.Invoke(this, new PropertyChangedEventArgs("OutWorkCount"));
            }
        }


        /// <summary>
        /// 界面显示宽度
        /// </summary>
        public int ShowWidth {
            get {
                return OutWorkCount * 60 / 100;
            }
        }
    }
}
